<br/>
<?php if(!empty($details))
{
 ?>
     <section id="top_details" class="wrapper clearfix">
    	<div class="left_details">
            <?php $image = explode(',',$details->avartar); ?>
    		<img width="135" height="180" src="<?php echo get_thumnails($image[0],139,207); ?>" class="big_images" alt="<?php echo $details->name; ?>" />
    	</div>
    	<!-- /.left_details -->
    	<div class="center-details">
    		<h2 class="title_deyails"><?php echo $details->name; ?></h2>
    		<p class="sub_details"><?php echo $details->profile_tit; ?></p>
            <p><?php  echo $this->common_model->getnumber2('rating_star',array('tutorid'=>$details->id));?> Đánh giá</p>
    		<ul class="center2">
    			<li class="rating_details"><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i></li>
    			<li class="background"><a href="javascript://" title=""><i class="icon-check"></i> Đã vượt qua bài test</a></li>
    			<!-- /.background -->
    			<li class="center3"><i class="icon-email"></i><a href="javascript://">Gia sư sẽ trả lời email trong: <i style="color: red;"> <?php if(!empty($details->repmail)){ echo $details->repmail.'h'; }else{echo 'Chưa cập nhật';} ?></i></a></li>
                <li class="sosical">
                    <div class="fb-like" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
    			    <g:plusone></g:plusone>
                </li>
                <li class="center3">
                    <div class="thumnails">
                        <?php if(!empty($image)) { foreach ($image as $thumb){ echo '<img class="img_thumb" src="'.get_thumnails($thumb,139,207).'" width="35" height="35" alt="'.$details->name.'" />';}} ?>
                    </div>
                </li>
    		</ul>
    	</div>
    	<!-- /.center-details -->
    	<div class="right_details">
            <?php if(!empty($city)) { ?>
    		<a href="<?php echo base_url().'dia-diem/'.$city->id; ?>" class="localtion_details">
            <?php if(!empty($city->title)) { echo $city->title; } ?>,<?php if(!empty($huyen->title)) { echo $huyen->title; } ?></a><?php } ?>
    		<p>Học phí : <span style="color: red;font-weight:bold;"><?php if($details->mucluong != 0) { echo number_format($details->mucluong).'</span> VNĐ';} else{ echo 'Chưa cập nhật';} ?></p>
    		<p><?php //echo $details->details_luong; ?></p>
            <p>Bạn có thể học thử cho đến khi tìm được gia sư như ý</p>
            <a href="javascript://" data-action='email' class="click_details btn_details">Học gia sư này</a>
    	</div>
    	<!-- /.right_details -->
    </section>
    <!-- /#top_details -->
    <div class="des_tabs wrapper clearfix">
    <ul class="tabs_navi">
    	<li><a href="javascript://" data-action='info' class="click_details">Thông tin chung</a></li>
    	<li><a href="javascript://" class="click_details active_tabs" data-action='feedback'>Phản hồi từ học sinh</a></li>
    	<li><a href="javascript://" class="click_details" data-action='lession'>Thông tin về môn dạy</a></li>
    	<li><a href="javascript://" class="click_details" data-action='email'>Email</a></li>
    </ul>
    <!-- /.tabs_navi -->
    <div class="clearfix">&nbsp;</div>
    <section class="main_tabs">
        <div class="left_mail">
			<div class="main_left_rate">
				<?php if(!empty($ratting)) { foreach($ratting as $rt): ?>
				<section class="row4 padding10 margin5 des_rate_tutor">
					<i class="icon-quote-left icon-2x blue"></i>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $rt->description; ?>&nbsp;&nbsp;&nbsp;&nbsp;<i class="icon-quote-right icon-2x blue"></i>
				</section>
				<?php endforeach; } else { echo 'Hãy là người đầu tiên viết đánh giá cho gia sư này !<br />';} ?>
				<?php if($this->session->userdata('id')) { echo '<a href="javascript://" class="btn_view vietdanhgia" style="width: 150px;color:#fff;" title="đánh giá giáo viên">Viết đánh giá</a>';}
					  else {echo 'Hãy <a href="'.base_url().'dang-nhap.html" title="Đăng nhâp" >đăng nhập</a>để sử dụng chức năng viết đánh giá!';}
				 ?>
			</div>
			<div class="form_danhgia" style="display: none;"><div class="node"></div><p>Tiêu đề:</p><input type="text" id="title_rate" value="" required="required" style="width: 100%;" /><p>Nội dung đánh giá</p><textarea required="required" id="des_rate" style="width: 100%;" rows="20"></textarea><a href="javascript://" class="btn_view guidanhgia" style="color:#fff;width:150px;">Gửi đánh giá</a></div>
		</div>
    <div class="right_mail">
        <div class="col_de1">
            <h3 class="blue_heading"><i class="icon-thumbs-up"></i>&nbsp;&nbsp;&nbsp;&nbsp;Đánh giá giáo viên</h3>
            <div class="main_rate">
                <p class="star"><?php for($i=1;$i<=$sosao;$i++){ echo '<i class="icon-star"></i>'; }?></p>
                <p>Học sinh đánh giá bài dạy của giáo viên</p>
                <div class="rate_details">
                    <div class="node2"></div>
                    <p class="clearfix"><span class="tt_rate">5 <i class="icon-star"></i> :</span><a class="danhgia" data-star="5sao" href="javascript://" title="Đánh giá rất tốt"><span class="orangebg" style="width: <?php echo $percent5; ?>%;">&nbsp;</span>Tốt</a><span class="num_rate">(<?php echo $fivestar; ?>)</span></p>
                    <p class="clearfix"><span class="tt_rate">4 <i class="icon-star"></i>:</span><a class="danhgia" data-star="4sao" href="javascript://" title="Đánh giá tốt"><span class="orangebg" style="width: <?php echo $percent4; ?>%;">&nbsp;</span>Tốt</a><span class="num_rate">(<?php echo $fourstar; ?>)</span></p>
                    <p class="clearfix"><span class="tt_rate">3 <i class="icon-star"></i> :</span><a class="danhgia" data-star="3sao" href="javascript://" title="Đánh giá Khá"><span class="orangebg" style="width: <?php echo $percent3; ?>%;">&nbsp;</span>Tốt</a><span class="num_rate">(<?php echo $threestar; ?>)</span></p>
                    <p class="clearfix"><span class="tt_rate">2 <i class="icon-star"></i> :</span><a class="danhgia" data-star="2sao" href="javascript://" title="Đánh giá Trung bình"><span class="orangebg" style="width: <?php echo $percent2; ?>%;">&nbsp;</span>Tốt</a><span class="num_rate">(<?php echo $twostar; ?>)</span></p>
                    <p class="clearfix"><span class="tt_rate">1 <i class="icon-star"></i> :</span><a class="danhgia" data-star="1sao" href="javascript://" title="Đánh giá Kém"><span class="orangebg" style="width: <?php echo $percent1; ?>%;">&nbsp;</span>Tốt</a><span class="num_rate">(<?php echo $onestar; ?>)</span></p>
                </div>
            </div>
        </div>
        <?php $this->load->view('com_tutors/views_form_email.php'); ?>
    </div>
     <script>
            // AJAX DANH GIA
            $(document).ready(function(){
                $('.vietdanhgia').click(function(){
                    $('.main_left_rate').remove();
                    $('.form_danhgia').fadeIn();
                });
            });
            $(document).ready(function(){
                $('.guidanhgia').click(function(){
                    var title_rate = $('#title_rate').val();
                    var des_rate =$('#des_rate').val();
                    var url = window.location.href;
                    $.ajax({
                              type: "POST",
                              url: '<?php echo base_url(); ?>ajax/vietdanhgia',
                              data: {
                                title_rate : title_rate,
                                des_rate : des_rate,
                                url : url
                                },
                              success: success
                            });
                    });
                    function success(data,status){
                            $('.node').html(data);
                           };
                });
        </script>
    <script>
    $(document).ready(function(){
        $('.danhgia').click(function(){
           var url2 = window.location.href;
           var action = $(this).attr('data-star');
           var idu = <?php echo $this->session->userdata('id');?>;
           $('.rate_details').prepend('<p class="load">Đang tải dữ liệu</p>');
           $.ajax({
                  type: "POST",
                  url: '<?php echo base_url(); ?>ajax/ratestar',
                  data: {
                    idu : idu,
                    action : action,
                    url2 : url2
                    },
                  success: success2
                });
        });
        function success2(data,status){
                            $('.node2').html(data);
                            $('.load').remove();
                               setTimeout(function(){window.location.reload();},5000);
                           };
    });
    </script>
    </section>
                <?php 
                    $alias = preg_replace("/(.html)/",'', $this->security->xss_clean($this->uri->segment(1,0)));
                    $idusser = substr($alias,17);
                ?>
    <script>
    	$(document).ready(function() {
    		$('.click_details').click(function() {
    			/* Act on the event */
                $('.tabs_navi li a').removeClass('active_tabs');
    	        $(this).addClass('active_tabs');
                var action = $(this).attr('data-action');
                var url = window.location.href;
                $('.main_tabs'). prepend('<div><i class="icon-spinner icon-spin icon-large"></i> Đang tải dữ liệu vui lòng đợi...</div>')
                 $.ajax({
                          type: "POST",
                          url: '<?php echo base_url(); ?>ajax/thong-tin-gia-su<?php echo '.',$idusser;?>',
                          data: {
                            action : action,
                            url : url
                            },
                          success: success
                        });
    		});
            function success(data,status){
                $('.main_tabs').html(data);
               };
    	});
    </script>
 <?php } else { ?>
 <section  class="wrapper min720">
    <h2><?php echo $thongbao; ?></h2>
 </section>
 <?php } ?>
 <script>
    $(document).ready(function(){
       $('.thumbvideos').click(function(){
            $('.popup_video').fadeIn();
            $('.overlay').fadeIn();
       }); 
       $('.close').click(function(){
            $('.popup_video').fadeOut();
             $('.overlay').fadeOut();
       });
    });
 </script>
<style>
#main_mon
{
    width:100%;
}
#main_mon li
{
    list-style:none;
}
#main_mon li.parent_sub span.parent
{
    color:#ff9900;
    font-weight:bold;
    text-transform: capitalize;
    border-bottom:1px dashed #ccc;
    padding-bottom:10px;
    display:block;
}
#main_mon li.parent_sub ul li
{
    margin-left:15px;
}
#main_mon li.parent_sub ul li span
{
    color:#333;
    font-weight:normal;
}
</style>